predicated

fun <T> predicated(storedVal: T, valid: Boolean, error: String): ValidationResult<T>

Convenience shortcut for creating a success or error depending on a boolean state.

Used if the value returned will be the same regardless of validation, eg. in the case of EntryValidator usage, where no changes are being made to the result

Return

the error ValidationResult

Author

fzzyhmstrs

Since

0.2.0

Parameters

T

Type of result

storedVal

default or fallback instance of type T

valid

test applied to determine validation or error.

error

string with error message